import request from '@/utils/request'

const api_name = '/admin/system/sysUser'

export default {
  // 分页查询
  getPageList(page, limit, searchObj) {
    return request({
      url: `${api_name}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  // 删除用户
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },
  // 获得用户
  get(id) {
    return request({
      url: `${api_name}/get/${id}`,
      method: 'get'
    })
  },
  // 添加用户
  save(sysUser) {
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: sysUser
    })
  },
  // 修改用户
  updateById(sysUser) {
    return request({
      url: `${api_name}/update`,
      method: 'put',
      data: sysUser
    })
  },
  // 修改状态
  updateStatus(id, status) {
    return request({
      url: `${api_name}/updateStatus/${id}/${status}`,
      method: 'get'
    })
  }
}
